package day14.homework02;


import java.util.concurrent.*;

/**
 * @author Xiao
 * @date 2021/8/7
 */
@SuppressWarnings("all")
public class Test06 {
    /**
     * 6. 编写线程池两种实现方式（1. 使用工具类， 2. 自己new）
     */
    public static void main(String[] args) {
        ExecutorService pool1 = Executors.newCachedThreadPool();

        ExecutorService pool2 = Executors.newFixedThreadPool(5);

        ThreadPoolExecutor pool3 = new ThreadPoolExecutor(
                2,
                5,
                10,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(5),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy());
    }
}
